"use strict";

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = (app) => {
  const { router, controller } = app;
  /*********************** 页面 ***********************/
  router.get("/", controller.home.index);
  router.get("/fundcode/all", controller.fundcode.all);
  router.get("/fundcode/rank", controller.fundcode.rank);

  /*********************** 页面 ***********************/

  /*********************** API ***********************/
  router.get("/fund/reptile/:id", controller.fund.getFundDetails);
  router.resources("users", "/users", controller.users);
  // router.resources('fund', '/api/fund/', controller.fund.getFundDetails);

  // 全部基金
  router.get(
    "/v1/reptile/downloadFundCode",
    controller.v1.fund.list.downloadFundCode
  );
  router.post(
    "/v1/reptile/postFundCodeToSql",
    controller.v1.fund.list.postFundCodeToSql
  );

  // 每日排名
  router.get(
    "/v1/reptile/downloadFundRankData",
    controller.v1.fund.ranking.downloadFundRankData
  );
  router.post(
    "/v1/reptile/postFundRankToSql",
    controller.v1.fund.ranking.postFundRankToSql
  );

  /*********************** API ***********************/
};
